<?
require_once("../global.php");
require_once("libs/faktur-masuk.inc.php");
baca_permisi(3);
if($permisi[access]!="izin"){
	echo "<script>window.location='../warning.php'</script>";
}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>.: Sim Pajak NK :.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../tampilan.css" type="text/css">
<link rel="stylesheet" href="../bgsubmenu.css" type="text/css">
<script>
<!--
function pindah(){
        var buku = document.all['inp_par[buku]'].value;
        var bayar = document.all['inp_par[bayar]'].value;
        var lapor = document.all['inp_par[lapor]'].value;
        var cari = document.all['inp_par[txtcari]'].value;
        var hr = document.all['inp_par[hari]'][document.all['inp_par[hari]'].selectedIndex].value;
        var bln = document.all['inp_par[bulan]'][document.all['inp_par[bulan]'].selectedIndex].value;
	var thn = document.all['inp_par[tahun]'][document.all['inp_par[tahun]'].selectedIndex].value;
        var hr_ = document.all['inp_par[hari_]'][document.all['inp_par[hari_]'].selectedIndex].value;
        var bln_ = document.all['inp_par[bulan_]'][document.all['inp_par[bulan_]'].selectedIndex].value;
	var thn_ = document.all['inp_par[tahun_]'][document.all['inp_par[tahun_]'].selectedIndex].value;
        var kode = document.all['inp_par[divisi_kode]'][document.all['inp_par[divisi_kode]'].selectedIndex].value;
         window.location.href ='?inp_par[buku]='+buku+'&inp_par[bayar]='+bayar+'&inp_par[lapor]='+lapor+'&inp_par[txtcari]='+cari+'&inp_par[hari]='+hr+'&inp_par[bulan]='+bln+'&inp_par[tahun]='+thn+'&inp_par[hari_]='+hr_+'&inp_par[bulan_]='+bln_+'&inp_par[tahun_]='+thn_+'&inp_par[divisi_kode]='+kode;
}

function Start(page,lebar,tinggi) {
	OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width="+lebar+",height="+tinggi);
}

function Customer() {
	NAME = "ACCOUNT";
	OPTIONS = "width=650,height=500,screenX=750,toolbars=1,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1";
	var windows=window.open("pilih-customer.php", NAME, OPTIONS);
}

function Proyek() {
	NAME = "ACCOUNT";
	OPTIONS = "width=650,height=500,screenX=750,toolbars=1,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1";
	var windows=window.open('pilih-proyek.php?', NAME, OPTIONS);
}

function nextField(objAsal, objKe){
		var batas = document.all[objAsal].maxLength;
		var Char = document.all[objAsal].value;
		var jmlChar = Char.length;
		if(parseInt(batas) == parseInt(jmlChar)){
			document.all[objKe].select();
		}else{
			document.all[objAsal].focus();
		}
}
function gantitahun(){
        tahunfaktur=document.all['inp[nofak3]'].value;
        tahunfaktur='20'+tahunfaktur;
        document.all['inp[tahun]'].value=tahunfaktur;
}

function disablebaru(var1,var2,var3){
        el1=document.all[var1].checked;
        if (el1==true){
            document.all[var2].disabled=false;
            if (var3!=""){
                document.all[var3].disabled=false;
            }
        }else{
            document.all[var2].disabled=true;
            if (var3!=""){
                document.all[var3].disabled=true;
            }
        }
}


function disable(){
//    alert(document.all['inp[is_buku]'].value);
        no_faktur=document.all['inp[nofak1]'].value+'.'+document.all['inp[nofak2]'].value+'-'+document.all['inp[nofak3]'].value+'.'+document.all['inp[nofak4]'].value;
	tanggal_faktur= document.all['inp[tahun]'].value+'-'+document.all['inp[bulan]'].value+'-'+document.all['inp[hari]'].value;
	id_leveransir = document.all['inp[id_leveransir]'].value;
	dpp= document.all['inp[dpp]'].value;
        dpp=dpp.replace(/,/g,"");
	ppn= document.all['inp[ppn]'].value;
        ppn=ppn.replace(/,/g,"");
	id_proyek= document.all['inp[id_proyek]'].value;
	is_buku= document.all['inp[is_buku]'].checked;
	bukti_pembukuan= document.all['inp[bukti_pembukuan]'].value;
	is_bayar= document.all['inp[is_bayar]'].checked;
	bukti_pembayaran= document.all['inp[bukti_pembayaran]'].value;
        is_lapor= document.all['inp[is_lapor]'].checked;
	tanggal_lapor= document.all['inp[tahun4]'].value+'-'+document.all['inp[bulan4]'].value;

	window.location.href ='?<?=var_kirim($inp_par)?>&inp[no_faktur_pajak]='+no_faktur+'&inp[tgl_faktur]='+tanggal_faktur+'&inp[id_leveransir]='+id_leveransir+'&inp[dpp]='+dpp+'&inp[ppn]='+ppn+'&inp[id_proyek]='+id_proyek+'&inp[is_buku]='+is_buku+'&inp[bukti_pembukuan]='+bukti_pembukuan+'&inp[is_bayar]='+is_bayar+'&inp[bukti_pembayaran]='+bukti_pembayaran+'&inp[is_lapor]='+is_lapor+'&inp[tanggal_lapor]='+tanggal_lapor+'';
}

function angka(objek) {
	objek = typeof(objek) != 'undefined' ? objek : 0;
	a = objek.value;
	b = a.replace(/[^\d]/g,"");
	c = "";
	panjang = b.length;
	j = 0;
	for (i = panjang; i > 0; i--) {
		j = j + 1;
		if (((j % 3) == 1) && (j != 1)) {
		c = b.substr(i-1,1) + "," + c;
		} else {
			c = b.substr(i-1,1) + c;
		}
	}
	objek.value = c;
        }

function itung(){
        var Char1 = document.all['inp[dpp]'].value;
        a=Char1
        b=a.replace(/,/g,"");
        c = 0.1*b;
        document.all['inp[ppn]'].value = Math.round(c);
        document.all['inp[ppn]'].focus();
    }

function ToUpper(ctrl){
        var t = ctrl.value;
        ctrl.value = t.toUpperCase();
    }


//-->
</script>
</head>
<?=$fungsi_pindah?>
<body>
<?=generate_form($inp_par)?>
</body>
</html>
